﻿'
' Created by SharpDevelop.
' User: MKurt4
' Date: 5/2/2014
' Time: 1:57 PM
' 
' To change this template use Tools | Options | Coding | Edit Standard Headers.
'
Public Partial Class MFWEdit
	Public Sub New()
		' The Me.InitializeComponent call is required for Windows Forms designer support.
		Me.InitializeComponent()
		
		'
		' TODO : Add constructor code after InitializeComponents
		'
	End Sub
	
	Sub ExitToolStripMenuItemClick(sender As Object, e As EventArgs)
Me.Close()		
	End Sub
	
	Sub NewToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Text = ""		
	End Sub
	
	Sub SaveToolStripMenuItemClick(sender As Object, e As EventArgs)
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text Files|*.txt|HTML Files|*.htm|Marecrosoft Writer Format|*.mfw|All Files|*.*"
Save.CheckPathExists = True
Save.Title = "Save File"
Save.ShowDialog(Me)
Try 
	myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(richTextBox1.Text)
myStreamWriter.Flush()
Catch ex As Exception
End Try		
	End Sub
	
	Sub OpenToolStripMenuItemClick(sender As Object, e As EventArgs)
Dim Open As New OpenFileDialog()
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Text Files|*.txt|HTML Files|*.htm|Marecrosoft Writer Format|*.mfw|All Files|*.*"
Open.CheckFileExists = True
Open.Title = "OpenFile"
Open.ShowDialog(Me)
Try
Open.OpenFile()
myStreamReader =
System.IO.File.OpenText(Open.FileName)
richTextBox1.Text =
myStreamReader.ReadToEnd()
Catch ex As Exception
End Try		
	End Sub
	
	Sub ColorToolStripMenuItemClick(sender As Object, e As EventArgs)
Dim FC As New ColorDialog
Try
FC.ShowDialog()
richTextBox1.ForeColor = FC.Color
Catch ex As Exception
End Try		
	End Sub
	
	Sub FamilyToolStripMenuItemClick(sender As Object, e As EventArgs)
FontDialog1.Font = richTextBox1.Font
FontDialog1.ShowDialog()
richTextBox1.Font = FontDialog1.Font		
	End Sub
	
	Sub UndoToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Undo()		
	End Sub
	
	Sub RedoToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Redo()	
	End Sub
	
	Sub SelectAllToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.SelectAll()		
	End Sub
	
	Sub CutToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Cut()		
	End Sub
	
	Sub CopyToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Copy()		
	End Sub
	
	Sub PasteToolStripMenuItemClick(sender As Object, e As EventArgs)
richTextBox1.Paste()		
	End Sub
End Class
